{% load forum_tags %}
{% with params=request.GET.urlencode %}
    <div class="ui horizontal basic top-menu segments">

        <div style="padding-right: 19px;">
            <div class="ui small compact menu sorting no-box-shadow">
                <div class="ui simple dropdown item">
                    Limit
                    <i class="dropdown icon"></i>

                    <div class="menu">

                        <a class="item" href="{% relative_url 'all' 'limit' params %}">
                            <i class="{% activate_check_mark limit 'all' %}"></i>all time
                        </a>
                        <a class="item" href="{% relative_url 'today' 'limit' params %}">
                            <i class="{% activate_check_mark limit 'today' %}"></i>today
                        </a>
                        <a class="item" href="{% relative_url 'week' 'limit' params %}">
                            <i class="{% activate_check_mark limit 'week' %}"></i>this week
                        </a>
                        <a class="item" href="{% relative_url 'month' 'limit' params %}">
                            <i class="{% activate_check_mark limit 'month' %}"></i>this month
                        </a>
                        <a class="item" href="{% relative_url 'year' 'limit' params %}">
                            <i class="{% activate_check_mark limit 'year' %}"></i>this year
                        </a>
                        <div class="ui divider"></div>
                        <a class="item" href="{% url 'post_topic' 'open' %}">
                            <i class="{% activate_check_mark type 'open' %}"></i>Unanswered
                        </a>

                        <a class="item" href="{% url 'post_list' %}">
                            <i class="{% activate_check_mark type 'latest' %}"></i>All posts
                        </a>
                        {%  if  request.user.profile.is_moderator %}

                         <a class="item" href="{% url 'post_topic' 'spam' %}">
                            <i class="{% activate_check_mark type 'spam' %}"></i>Spam posts
                        </a>
                        {% endif %}


                    </div>
                </div>
            </div>
        </div>

        <div style="padding-right: 19px;">
            <div class="ui small compact menu sorting no-box-shadow">
                <div class="ui simple dropdown item">
                    Sort
                    <i class="dropdown icon"></i>

                    <div class="menu">

                        <a class="item" href="{% relative_url 'update' 'order' params %}">
                            <i class="{% activate_check_mark order 'update' %}"></i>Update
                        </a>
                        <a class="item" href="{% relative_url 'answers' 'order' params %}">
                            <i class="{% activate_check_mark order 'answers' %}"></i>Answers
                        </a>
                         <a class="item" href="{% relative_url 'bookmarks' 'order' params %}">
                            <i class="{% activate_check_mark order 'bookmarks' %}"></i>Bookmarks
                        </a>
                          <a class="item" href="{% relative_url 'creation' 'order' params %}">
                            <i class="{% activate_check_mark order 'creation' %}"></i>Creation
                        </a>
                        <a class="item" href="{% relative_url 'replies' 'order' params %}">
                            <i class="{% activate_check_mark order 'replies' %}"></i>Replies
                        </a>
                        <a class="item" href="{% relative_url 'rank' 'order' params %}">
                            <i class="{% activate_check_mark order 'rank' %}"></i>Rank
                        </a>
                        <a class="item" href="{% relative_url 'views' 'order' params %}">
                            <i class="{% activate_check_mark order 'views' %}"></i>Views
                        </a>

                        <a class="item" href="{% relative_url 'votes' 'order' params %}">
                            <i class="{% activate_check_mark order 'votes' %}"></i>Votes
                        </a>

                    </div>
                </div>
            </div>
        </div>
    </div>
{% endwith %}
